import mesop as me
import mesop.labs as mel

def chat_transform(input: str, history: list[mel.ChatMessage]) -> str:
    return f"You said: {input}"

@me.page(path="/chat")
def chat_page():
    with me.box(style=me.Style(padding=me.Padding.all(16), max_width=600, margin=me.Margin.symmetric(horizontal="auto"))):
        me.text("Welcome to the Chat", type="headline-4")
        mel.chat(
            transform=chat_transform,
            title="Simple Chat",
            bot_user="Assistant"
        )